package com.rpcLearning.server;

import com.rpcLearning.common.ReflectUtils;
import com.rpcLearning.proto.Request;

/**
 * @author:zyh
 * @Time:2021-03-17-20:13
 * @email:1269231889@qq.com
 */
public class ServiceInvoker {
    public Object invoker(ServiceInstance service,
                          Request req){

        return ReflectUtils.invoke(service.getTarget(),
                                    service.getMethod(),
                                    req.getParameters()
                                    );
    }
}
